package com.example.asus.a222dzd_ordering.base;

import com.example.asus.a222dzd_ordering.bean.CollectListBean;
import com.example.asus.a222dzd_ordering.bean.FoodListBean;
import com.example.asus.a222dzd_ordering.bean.LoginBean;
import com.example.asus.a222dzd_ordering.bean.RegisterBean;
import com.example.asus.a222dzd_ordering.bean.ShopBean;
import com.example.asus.a222dzd_ordering.bean.UserBean;
import com.example.asus.a222dzd_ordering.bean.UserInfoBean;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;


public interface Service {

    //登陆
    @GET("userLogin.do")
    Call<LoginBean> login(@Query("username") String username,
                          @Query("userpass") String userpass);

    //注册
    @GET("userRegister.do")
    Call<RegisterBean> register(@Query("username") String username,
                                @Query("userpass") String userpass,
                                @Query("mobilenum") String mobilenum);

    //获取店铺列表
    @GET("getAllShops.do ")
    Call<List<ShopBean>> getShop();

    //获取店铺菜单
    @GET("getFoodByShop.do")
    Call<List<FoodListBean>> getFoodByShop(@Query("shop_id") int shop_id);

    //直接购买
    @GET("insertOrder.do")
    Call<UserBean> doBuy(@Query("user_id") int user_id,
                         @Query("food_id") int food_id,
                         @Query("num") int num,
                         @Query("sum") double sum,
                         @Query("suggesttime") String suggesttime,
                         @Query("address ") String address);

    //判断是否收藏
    @GET("isCollected.do")
    Call<UserBean> isCollected(@Query("user_id") int user_id,
                               @Query("shop_food_id") int shop_food_id,
                               @Query("flag") int flag);

    //收藏/取消收藏店铺
    @GET("userCollectShop.do")
    Call<UserBean> doCollectShop(@Query("user_id") int user_id,
                                 @Query("shop_id") int shop_id);

    //收藏/取消收藏菜谱
    @GET("userCollectFood.do ")
    Call<UserBean> doCollectFood(@Query("user_id") int user_id,
                                 @Query("food_id") int food_id);

    //获取收藏列表
    @GET("getAllUserCollection.do")
    Call<List<CollectListBean>> getCollectList(@Query("user_id") int user_id,
                                               @Query("flag") int flag);

    //搜索
    @GET("getFoodBySearch.do ")
    Call<List<FoodListBean>> getSearch(@Query("search") String search);
   //获取用户信息
    @GET("getUserById.do")
    Call<UserInfoBean> getUserInfo(@Query("user_id") String user_id);
}
